|
An exponential-Golomb code (or just Exp-Golomb code) is a type of universal code. To encode any nonnegative integer ''x'' using the exp-Golomb code: # Write down ''x''+1 in binary # Count the bits written, subtract one, and write that number of starting zero bits preceding the previous bit string. The first few values of the code are: 0 ⇒ 1 ⇒ 1 1 ⇒ 10 ⇒ 010 2 ⇒ 11 ⇒ 011 3 ⇒ 100 ⇒ 00100 4 ⇒ 101 ⇒ 00101 5 ⇒ 110 ⇒ 00110 6 ⇒ 111 ⇒ 00111 7 ⇒ 1000 ⇒ 0001000 8 ⇒ 1001 ⇒ 0001001 ...〔 This is identical to the Elias gamma code of ''x''+1, allowing it to encode 0. ==Extension to negative numbers== Exp-Golomb coding for ''k'' = 0 is used in the H.264/MPEG-4 AVC and H.265 High Efficiency Video Coding video compression standards, in which there is also a variation for the coding of signed numbers by assigning the value 0 to the binary codeword '0' and assigning subsequent codewords to input values of increasing magnitude (and alternating sign, if the field can contain a negative number): 0 ⇒ 0 ⇒ 1 ⇒ 1 1 ⇒ 1 ⇒ 10 ⇒ 010 −1 ⇒ 2 ⇒ 11 ⇒ 011 2 ⇒ 3 ⇒ 100 ⇒ 00100 −2 ⇒ 4 ⇒ 101 ⇒ 00101 3 ⇒ 5 ⇒ 110 ⇒ 00110 −3 ⇒ 6 ⇒ 111 ⇒ 00111 4 ⇒ 7 ⇒ 1000 ⇒ 0001000 −4 ⇒ 8 ⇒ 1001 ⇒ 0001001 ... In other words, a non-positive integer ''x''≤0 is mapped to an even integer −2''x'', while a positive integer ''x''>0 is mapped to an odd integer 2''x''−1. Exp-Golomb coding is also used in the Dirac video codec.〔(【引用サイトリンク】url=http://diracvideo.org/download/specification/dirac-spec-latest.pdf )〕 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Exponential-Golomb coding」の詳細全文を読む スポンサード リンク
|